import numpy as np
import matplotlib.pyplot as plt

z = np.arange(-10,10,0.1)
def g(z):
    return 1/(1+np.exp(-z))
g_arr = g(z)

plt.plot(z,g_arr, '.', linewidth=.03)
plt.plot([-10, 10],[0.5, 0.5])
plt.xlim([-10, 10])
plt.xlabel('$z$')
plt.ylabel('$g(z)$')
plt.savefig('4.3-sigmoid.png')
plt.show()